package hl.demosample.viewmodel.request

import androidx.lifecycle.MutableLiveData
import hl.demosample.app.network.apiService2
import hl.demosample.app.network.stateCallback.ListDataGirlClassifyUiState
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.requestNoCheck

/*
* path: DemoSample 
* Author: 86133
* Create: 2021-06-30 15:06
* Changes (from 2021-06-30)
* Desc:
*/
class RequestGirlClassifyViewModel : BaseViewModel() {

    var mData = MutableLiveData<ListDataGirlClassifyUiState>()

    fun girlClassify(hot_type: String, category: String, page: Int, count: Int) {
        requestNoCheck({ apiService2.girlClassify(hot_type, category, page, count) }, {
            val listDataUiState =
                ListDataGirlClassifyUiState(status = it.status, listData = it.data)
            mData.value = listDataUiState
        }, {
            val listDataUiState =
                ListDataGirlClassifyUiState(status = it.errCode, listData = arrayListOf())
            mData.value = listDataUiState
        })
    }
}